import React from 'react';
import { saveAs } from 'file-saver';
import htmlToDocx from 'html-docx-js/dist/html-docx';
import { htmlStr } from './constants.ts'
import './App.css';

function App() {
  const handleClick = () => {
    const convertedDocx = htmlToDocx.asBlob(htmlStr);
    saveAs(convertedDocx, `exported-document-${Date.now()}.docx`);
  }
  return (
    <div className="App">
      <header className="App-header">
        <textarea>{htmlStr}</textarea>
       <button onClick={handleClick}>html-to-docx</button>
      </header>
    </div>
  );
}

export default App;
